package com.bjsxt.shop.common.controller;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.bjsxt.shop.common.util.ConstatFinalUtil;
import com.bjsxt.shop.common.util.HttpUtil;

/**
 * 外部接口的父类
 * 
 * @author wangshSxt
 *
 */
@Controller
@RequestMapping("/outer/")
public class OuterController extends BaseController
{
	/**
	 * 地区列表
	 * @return
	 */
	@RequestMapping(value="/regionList",produces="text/html;charset=UTF-8")
	@ResponseBody
	public String regionList(HttpServletRequest request)
	{
		HttpUtil httpUtil = new HttpUtil();
		/* 接收参数 */
		String json = request.getParameter("json");
		String requestURL = ConstatFinalUtil.BUNDLE.getString("region.url") ; 
		Map<String, String> paramsMap = new HashMap<String, String>();
		paramsMap.put("json", json);
		/* 请求后台 */
		String resultJSON = httpUtil.methodPost(requestURL, Collections.emptyMap(), paramsMap);
		return resultJSON; 
	}
}
